import { Injectable } from '@angular/core';
import { HttpService } from '../providers/HttpService';
import { map, mergeMap } from 'rxjs/operators';
import { Observable, of } from 'rxjs';
import { FileService } from '../providers/FileService';
import { ValidationErrors } from '@angular/forms';
import * as constants from '../providers/Constants'
import { HttpHelper, RequestSetting } from '../providers/HttpHelper';
@Injectable({
    providedIn: 'root'
})
export class NewService {
    constructor(public http: HttpService, public fileService: FileService) {
    }

    // 获取新闻列表
    getNewsList(data,setting: RequestSetting = {}) {
        return this.http.post(constants.ApiServeNoLogin.getNewsList, data,setting);
    }
    // 获取商品列表
    getNewsDetail(data) {
        return this.http.post(constants.ApiServeNoLogin.getNewsDetail, data);
    }
    // 	获取招商信息
    getAgentInfo(data) {
        return this.http.post(constants.ApiServeNoLogin.getAgentInfo, data, { showLoading: false });
    }
    // // 	2.6.10	获取主页轮播图片
    // getCarousel(data) {
    //     return this.http.post(constants.ApiServeNoLogin.getCarousel, data, { showLoading: false });
    // }

    // 获取图片地铁
    getImageUrl() {
        return this.http.getImageUrl();
    }

    //获取系统消息
    getSystemMsg(data){
        return this.http.post(constants.ApiServeLogin.userQuestion,data);
    }



       // 获取新闻列表
       queryChatRecordList(data,setting: RequestSetting = {}) {
        return this.http.post(constants.ApiServeNoLogin.queryChatRecordList, data,setting);
    }
    // 获取商品列表
    addChatRecord(data) {
        return this.http.post(constants.ApiServeNoLogin.addChatRecord, data);
    }
}
